
GO
CREATE ROLE [ESBPortal]
    AUTHORIZATION [dbo];
GO

-- Assign object level permissions to Database Roles
-- ESBPortal PermissionsGRANT EXECUTE ON usp_select_Reports_AlertSubscriptionsOverTime TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Reports_AlertSubscriptionsOverTime_ByService TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistoryByName TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistoryReportByService TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistoryReportByApplication_Over_Time TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertSubscription_Count_Over_Time_By_Application_ServiceName TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertSubscription_Count_Over_Time_By_Application TO ESBPortal
GO
GRANT EXECUTE ON usp_delete_AlertConditionByID TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_AlertCondition TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertConditionsByAlertID TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Active_AlertSubscriptions TO ESBPortal
GO
GRANT EXECUTE ON usp_update_AlertSubscriptionByID TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_AlertSubscription TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertSubscriptions TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertSubscriptionsByAlertID TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_AlertSubscriptionHistory TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_ProcessedFault TO ESBPortal
GO
GRANT SELECT ON Fault TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Configuration TO ESBPortal
GO
GRANT EXECUTE ON usp_update_Configuration TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_By_ServiceName TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_ServiceName TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_By_Application TO ESBPortal
GO
GRANT EXECUTE ON usp_update_AlertEmail TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertSubscriptionsBySubscriber TO ESBPortal
GO
GRANT EXECUTE ON usp_delete_AlertSubscriptionByID TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Faults TO ESBPortal
GO
GRANT INSERT ON UserSetting TO ESBPortal
GO
GRANT SELECT ON UserSetting TO ESBPortal
GO
GRANT UPDATE ON UserSetting TO ESBPortal
GO
GRANT SELECT ON AlertEmail TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Reports_Alerts TO ESBPortal
GO
GRANT SELECT ON Alert TO ESBPortal
GO
GRANT SELECT ON Batch TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_By_Error_Type TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_By_Error_Type_By_Application TO ESBPortal
GO
GRANT SELECT ON ProcessedFault TO ESBPortal
GO
GRANT EXECUTE ON usp_select_FaultsToQueue TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertEmail TO ESBPortal
GO
GRANT INSERT ON Configuration TO ESBPortal
GO
GRANT SELECT ON Configuration TO ESBPortal
GO
GRANT UPDATE ON Configuration TO ESBPortal
GO
GRANT DELETE ON AlertCondition TO ESBPortal
GO
GRANT INSERT ON AlertCondition TO ESBPortal
GO
GRANT SELECT ON AlertCondition TO ESBPortal
GO
GRANT UPDATE ON AlertCondition TO ESBPortal
GO
GRANT DELETE ON AlertSubscription TO ESBPortal
GO
GRANT INSERT ON AlertSubscription TO ESBPortal
GO
GRANT SELECT ON AlertSubscription TO ESBPortal
GO
GRANT UPDATE ON AlertSubscription TO ESBPortal
GO
GRANT SELECT ON AlertSubscriptionHistory TO ESBPortal
GO
GRANT EXECUTE ON usp_delete_AlertByID TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertByID TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_Alert TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Alerts TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertStatistics TO ESBPortal
GO
GRANT EXECUTE ON usp_update_Alert TO ESBPortal
GO
GRANT EXECUTE ON usp_select_NonSubscribedAlertStatistics TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Reports_ResubmissionsByService TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Application_By_Month TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Application_By_Hour TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Application_By_Day TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Application_By_Minute TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_ErrorType TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_By_Application_GroupByServices TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Service TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Service_And_Hour TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistoryReportByServiceFault TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Faults_Messages TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Single_Fault TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_Fault TO ESBPortal
GO
GRANT SELECT ON vw_AggregatedFaults TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Application TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_AuditLog TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Faults_By_Application_And_ErrorType TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Fault_Count_Over_Time_By_Application_ServiceName TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Resubmission_Count_Over_Time_By_Application_ServiceName TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Faults_By_Application_And_Services TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Faults_From_AlertHistoryReportByServiceFault TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistoryReportByApplication TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Resubmission_Count_Over_Time_By_Application TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Reports_Resubmissions_ByService TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Reports_Resubmissions TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AuditLog TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_ContextProperty TO ESBPortal
GO
GRANT EXECUTE ON usp_select_ContextProperties TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Messages TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_Message TO ESBPortal
GO
GRANT EXECUTE ON usp_select_MessageBody TO ESBPortal
GO
GRANT EXECUTE ON usp_select_CanResubmitMessage TO ESBPortal
GO
GRANT EXECUTE ON usp_update_Message TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_AlertEmail TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_Batch TO ESBPortal
GO
GRANT EXECUTE ON usp_update_Batch TO ESBPortal
GO
GRANT EXECUTE ON usp_insert_AlertHistory TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistory_Count TO ESBPortal
GO
GRANT EXECUTE ON usp_select_AlertHistory TO ESBPortal
GO
GRANT EXECUTE ON usp_select_Reports_AlertHistoryOverTime TO ESBPortal
GO
